<?php
/**
 * Created by PhpStorm.
 * User: 氓羽
 * Date: 2018-4-18
 * Time: 17:38
 */
interface Person{
    public function eat();

    public function sleep();
}

class Man implements Person{
    public function eat(){
        echo "吃大餐";
    }

    public function sleep()
    {
        echo "睡个锤子！！！";
    }
}

class Woman implements Person{
    public function eat(){
        echo "吃112233";
    }

    public function sleep()
    {
        echo "睡个1111锤子！！！";
    }
}

class L{
    public static function factory(Person $user){
        return $user;
    }
}

$user = L::factory(new Woman());
$user->eat();
$user->sleep();
